package apollo.game.scene;

import java.util.ArrayList;

import apollo.game.core.Input;
import apollo.game.screen.Displayable;

public abstract class Scene implements Displayable {
	
	protected Scene parent;
	protected ArrayList<Displayable> childs;
	
	public Scene() {		
		childs = new ArrayList<Displayable>();
	}
	
	public abstract void tick(Input input);
	public abstract void init();
	
	public Displayable getParent() {
		return parent;
	}
	
	public int addChild(Displayable child) {
		childs.add(child);
		return childsNum();
	}
	
	public int removeChild(Displayable child) {
		childs.remove(child);
		return childsNum();
	}
	
	public int childsNum() {
		return childs.size();
	}
	
	public Displayable getChildAt(int index) {
		return childs.get(index);
	}
}
